<ion-view class="search-view" hide-back-button="true" title="">
  <ion-nav-buttons class="wrapper" side="left" style="width: 100%; background-color: #fff; color: #000">
    <button class="button button-clear" ng-click="goBack()">
      <i class="icon ion-chevron-left"></i>
    </button>
    <label style="background-color: #fff; width: 90%; border-radius: 20px; left: 30px; height: 35px; line-height: 33px; top: 5px; position: fixed; z-index: 1000">
      <i class="icon ion-search placeholder-icon" style="display: inline; padding-left: 10px"></i>
      <input id="search-input" ng-change="search(key)" ng-model="key" placeholder="搜索商品" style="display: inline; padding-left: 10px; background-color: #fff" type="text">
    </label>
  </ion-nav-buttons>
  <ul class="search-header row" style="position: fixed; top: 40px; z-index: 10">
    <li class="col col-33">
      <button class="button button-clear" ng-click="predicate = 'index'; reverse = false">默认</button>
    </li>
    <li class="col col-33">
      <button class="button button-clear icon-right" ng-click="orderby = 'kj_price'; reverse = !reverse">价格</button>
    </li>
    <li class="col col-34">
      <button class="button button-clear" ng-click="orderby = 'amount'; reverse = !reverse">人气</button>
    </li>
    <!-- <li class="col col-25">
			<button class="button button-clear" ng-click="setOrder(3)"><i class="ion-ios-settings-strong"></i></button>
		</li> -->
  </ul>
  <ion-content>
    <ul class="list" style="padding-top: 50px; z-index: 1">
      <li class="item row" ng-click="changeToGoods(goods)" ng-repeat="goods in goodslist | orderBy: orderby : reverse">
        <div class="col col-33">
          <img alt="" ng-if="!goods.smimgurl" ng-src="img/hd/file.png" style="width: 100%">
          <img alt="" ng-if="goods.smimgurl" ng-src="{{goods.smimgurl}}" style="width: 100%">
        </div>
        <div class="col">
          <div class="goods-name" style="margin-top: 8px; padding-left: 5px">
            {{goods.name}} {{goods.scale}}
          </div>
          <div>
            <div style="margin-top: 13px;">
              <div style="float: left; white-space: nowrap;">
                <b class="main-color" style="float: left;white-space: nowrap;">{{goods.kj_price}}
                  <span style="font-size: 12px;white-space: nowrap;">元</span>
                </b>
                <div style="clear: both"></div>
              </div>
              <div style="float: right; margin-top: -10px">
                <button class="button main-background main-btn" name="button" ng-click="addCart(goods); $event.stopPropagation();" ng-if="goods.amount > 0" style="width: 100px;" type="button">加入购物车</button>
                <button class="button main-btn" disabled="disabled" name="button" ng-if="goods.amount <= 0" style="width: 100px;" type="button">已售完</button>
              </div>
              <div style="clear:both"></div>
            </div>
          </div>
        </div>
      </li>
      <li class="item item-divider " style="text-align: center">
        没有更多商品
      </li>
    </ul>
  </ion-content>
  <div class="mycart" ui-sref-opts="{reload: true}" ui-sref="order.cart">
    <div class="button button-icon icon ion-android-cart" style="color: #fff; background-color: rgba(0,0,0,0.5); width: 50px; height: 40px;border-radius: 10px;"></div>
    <span class="cart-count" ng-hide="!count ||count == 0">{{count}}</span>
  </div>
</ion-view>
